<template>
	<view class="detail-page">
		<view class="card station-card">
			<image class="cover" :src="image" mode="aspectFill"></image>
			<view class="station-row">
				<view class="station-text">
					<view class="station-name">{{ name }}</view>
					<view class="station-sub">营业时间：周一—至周五 上午8:00-晚上22:00</view>
					<view class="station-addr">位置：{{ address }}
						<image class="addr-icon" src="/static/plane.png" mode="widthFix"></image>
					</view>
				</view>
				<button class="phone-btn">
					<uni-icons type="phone" color="#fff" size="22"></uni-icons>
				</button>
			</view>
		</view>

		<view class="card price-card">
			<view class="section-title">油价详情</view>
			<view class="price-list">
				<view class="price-item" v-for="(item, idx) in prices" :key="idx">
					<text class="fuel">{{ item.type }}</text>
					<text class="price">¥ {{ item.price }}/L</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				address: '',
				image: '',
				center: {
					latitude: 0,
					longitude: 0
				},
				target: {
					latitude: 0,
					longitude: 0
				},
				prices: [{
						type: '92#',
						price: '5.86'
					},
					{
						type: '95#',
						price: '5.86'
					},
					{
						type: '98#',
						price: '5.86'
					},
					{
						type: '0#',
						price: '5.86'
					}
				]
			};
		},
		onLoad() {
			try {
				const s = uni.getStorageSync('selectedStation');
				if (s) {
					this.name = s.name || this.name;
					this.address = s.address || this.address;
					this.latitude = Number(s.latitude || this.latitude);
					this.longitude = Number(s.longitude || this.longitude);
					this.image = s.image || this.image;
				} else {}
			} catch (e) {}
		},
		methods: {

		}
	};
</script>

<style scoped>
	.detail-page {
		padding: 20rpx;
		background-color: #f5f5f5;
		min-height: 100vh;
		background-image: linear-gradient(to bottom, #3486FD 0%, #0A64E7 300rpx, #f5f5f5 120rpx);
		background-repeat: no-repeat;
	}

	.card {
		background: #fff;
		border-radius: 16rpx;
		box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
	}

	.station-card {
		padding: 16rpx;
	}

	.cover {
		width: 100%;
		height: 360rpx;
		border-radius: 12rpx;
		margin-bottom: 20rpx;
	}

	.station-row {
		display: flex;
		align-items: center;
	}

	.station-text {
		flex: 1;
		min-width: 0;
	}

	.station-name {
		font-size: 30rpx;
		color: #333;
		font-weight: bold;
		margin-bottom: 10rpx;
	}

	.station-sub {
		font-size: 24rpx;
		color: #666;
		margin-bottom: 10rpx;
	}

	.station-addr {
		font-size: 24rpx;
		color: #666;
		display: flex;
		align-items: center;
		gap: 10rpx;
	}

	.addr-icon {
		width: 28rpx;
		margin-left: 10rpx;
	}

	.phone-btn {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		background: linear-gradient(180deg, #3FA3FF, #0A64E7);
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		border: none;
	}

	.phone-btn::after {
		border: none;
	}

	.price-card {
		margin-top: 20rpx;
		padding: 20rpx;
	}

	.section-title {
		font-size: 28rpx;
		color: #333;
		margin-bottom: 12rpx;
	}

	.price-list {
		background: #fff;
		border-radius: 12rpx;
	}

	.price-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 24rpx 10rpx;
		border-bottom: 1rpx solid #f0f0f0;
	}

	.price-item:last-child {
		border-bottom: none;
	}

	.fuel {
		font-size: 26rpx;
		color: #333;
	}

	.price {
		font-size: 26rpx;
		color: #FF8A00;
	}
</style>